package com.mmw.crm.result;

import lombok.Data;

@Data
public class Result<T> {

    //状态码
    private Integer code;
    //信息
    private String msg;
    //数据
    private T data;

    //构造私有化
    private Result() { }

    public static<T> Result<T> build(T data,String message,Integer code){
        Result<T> result = new Result<>();

        if (data != null){
            result.setData(data);
        }

        result.setCode(code);
        result.setMsg(message);

        return result;
    }


}
